package eventStrategies.physicalModel;

import model.IPhysicalDataModel;
import eventManager.AppEvent;
import eventStrategies.IEventResponse;
import events.ECodeEventList;
import events.physicalModel.AddItemEvent;

public class AddItemStrategy extends IEventResponse {

	private IPhysicalDataModel physModel;
	
	public AddItemStrategy(IPhysicalDataModel physModel) {
		super(ECodeEventList.ADD_ITEM);		
		this.physModel = physModel;
	}

	@Override
	public void execute(AppEvent event) {
		AddItemEvent fullEvent = (AddItemEvent) event;
		physModel.addItem(fullEvent.item);		
	}

}
